#include("/views/layout/_layout.html")
#@layout("blog - 发布")
#define main()
<div class="blog-main-left">
    <form class="layui-form">
        <div style="margin-right: 10px">
            <div style="padding-left: 40px;">
                <textarea id="md-editor">#(blog.content)</textarea>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <div class="layui-input-inline" style="margin: 10px 10px 0 40px;width: 500px">
                        <input type="hidden" class="layui-input" name="blog.id" value="#(blog.id??)">
                        <input type="text" class="layui-input" name="blog.title" lay-verify="required" placeholder="请输入标题"
                               value="#(blog.title??)">
                    </div>
                    <div class="layui-form-mid"></div>
                    <div class="layui-input-inline" style="margin: 10px 10px 0 40px;width: 500px;">
                        <!--<input type="text" class="layui-input" name="blog.tag" lay-verify="required" placeholder="请输入标签"
                               value="#(blog.tag??)">-->
                        <select id="selectTag" name="blog.tag">
                            #for(tag : tags)
                            <option value="#(tag.name)" #if(tag.name == blog.tag) selected #end>#(tag.name)</option>
                            #end
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">是否公开</label>
                    <div class="layui-input-inline">
                        <input type="checkbox" id="switchPub" lay-skin="switch" lay-text="是|否"
                               #if(blog.pub?? == true) checked #end>
                    </div>
                </div>
                <div style="float: right;">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit="" lay-filter="publishBlog"><i
                                class="fa fa-paper-plane"></i>&nbsp;发布</button>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
#end

#define right()
#include("/views/layout/_right.html")
#end

#define js()
<script type="text/javascript" src="#(ctx)/static/mditor/js/mditor.min.js"></script>
<script type="text/javascript" src="#(ctx)/static/js/blogForm.js"></script>
#end

#define css()
<link href="#(ctx)/static/mditor/css/mditor.min.css" rel="stylesheet"/>
#end